using System.ComponentModel.DataAnnotations;

namespace AdminSystem.API.Models
{
    public class Content
    {
        [Key]
        public int Id { get; set; }

        [Required]
        [StringLength(200)]
        public string Title { get; set; } = string.Empty;

        [Required]
        public string Body { get; set; } = string.Empty;

        [StringLength(50)]
        public string ContentType { get; set; } = "html"; // html, markdown, etc.

        public int AuthorId { get; set; }

        public bool IsPublished { get; set; } = false;

        public DateTime CreatedAt { get; set; } = DateTime.UtcNow;

        public DateTime? UpdatedAt { get; set; }

        public DateTime? PublishedAt { get; set; }

        // Navigation properties
        public virtual User Author { get; set; } = null!;
    }
}
